package com.itcast.myrpc.pipeline;

import com.itcast.myrpc.encoder.IntegerToByteBufEncoder;
import com.itcast.myrpc.handler.ClientHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @program: bio_tcp
 * @description: pipeline的编码过程流水线
 * @author: zhanghz001
 * @create: 2021-11-10 21:49
 **/
public class EncoderChannelInitializer extends ChannelInitializer<SocketChannel> {
    
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new IntegerToByteBufEncoder());
        ch.pipeline().addLast(new ClientHandler());
    }
}
